package day018.thread.demo6;

public class Test1 {
    public static void main(String[] args) {
        Object obj=new Object();

        new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (obj){
                    System.out.println("线程开始执行");
                    System.out.println("线程进入无线等待...");
                    try{
                        obj.wait();
                    }catch(InterruptedException e){
                        e.printStackTrace();
                    }
                    System.out.println("无限等待被唤醒...");
                }
            }
        }).start();
    }
}
